-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webserver): Implement file search and meta query #1731
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1731 +/- ##
==========================================
- Coverage 53.68% 52.90% -0.78%
==========================================
Files 115 115
Lines 9716 9897 +181
==========================================
+ Hits 5216 5236 +20
- Misses 4500 4661 +161 ☔ View full report in Codecov by Sentry. |
Consider add
|
a918ded
to
2f87646
Compare
fn match_glob(path: &str, glob: &str) -> bool { | ||
let glob = glob.to_lowercase(); | ||
let mut path = &*path.to_lowercase(); | ||
// Current behavior: Find each "word" (any substring separated by whitespace) appearing in the same order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wsxiaoys Tried using ignore
but couldn't get it behaving as I wanted, so I switched to async_walkdir
with my own glob filter instead. This comment explains its behavior, and I can show some screenshots to demonstrate how it works:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @liangfung
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why it cannot be using ignore - since you're implementing your own glob match anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ignore does not allow for custom globs for matching, only ignoring files as far as I can tell
- ignore is not async, and so would block the entire server's async runtime while it is running a search
- there is an option for parallel walking with ignore, but the crate as a whole does not seem better-suited to our task than async-walkdir - async makes more sense than parallel here, and ignore doesn't provide the globbing we want anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- As said - glob is implemented as customized filter anyway
- tokio manage its requests in multi threads async runtime. Thus won’t block
2841fd3
to
f874b75
Compare
Fixes TAB-547
cc @liangfung